/*!
    \file    change log.txt
    \brief   change log for GD32H75E demo

    \version 2026-07-31, V1.2.0, demo for GD32H75E
*/

/*
    Copyright (c) 2026, GigaDevice Semiconductor Inc.

    Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this
       list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.
    3. Neither the name of the copyright holder nor the names of its contributors
       may be used to endorse or promote products derived from this software without
       specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/

******************* V1.2.0 2026-07-31 ************************************************************************************

______________________Common______________________________________________________________________________________________
1.  GD32H73x_75x and GD32H75E Firmware Library Merged
Fix file:
../GD32H73x_75x_Demo_Suites/GD32H73x_75x_Firmware_Library

fix reason:
update the version from V1.6.0 to V1.7.0

2. GD32H75E basic file name modify

Fix file:
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h73x_75x_it.h
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h73x_75x_it.c
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h73x_75x_libopt.h

fix reason:
Renamed the GD32H75E Demo Suite basic project files from gd32h75e_* prefix to
gd32h73x_75x_* prefix, unifying the naming convention with the main firmware library
after the GD32H73x_75x and GD32H75E firmware library merge.

V1.1.0:
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h75e_it.h
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h75e_it.c
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h75e_libopt.h

V1.2.0:
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h75e_it.h -> gd32h73x_75x_it.h
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h75e_it.c -> gd32h73x_75x_it.c
../GD32H73x_75x_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/*/gd32h75e_libopt.h -> gd32h73x_75x_libopt.h

______________________ETHERCAT____________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/inc/gd32h73x_75x_it.h
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/inc/gd32h73x_75x_libopt.h
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/src/gd32h73x_75x_it.c

fix reason:
Add the interrupt header, library option and interrupt service routine files for the merged GD32H73x_75x_75E firmware.

V1.1.0:
none

V1.2.0:
Added gd32h73x_75x_it.h, gd32h73x_75x_libopt.h and gd32h73x_75x_it.c files


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/inc/gdesc.h
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/src/esc_exti.c
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/src/esc_timer.c
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/src/main.c

fix reason:
Replace the device header file with the merged GD32H73x_75x_75E firmware header file.

V1.1.0:
#include "gd32h75e.h"

V1.2.0:
#include "gd32h73x_75x.h"


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/23_EtherCAT/src/gdesc.c

fix reason:
Update the ESC PMU register names to the new definitions in the merged firmware library.

V1.1.0:
ospi_read(PMU_PDIREFVAL,(uint8_t*)&temp,4);

ospi_read(PMU_CTRL0,(uint8_t*)&temp,4);

V1.2.0:
ospi_read(ESC_PMU_PDIREFVAL,(uint8_t*)&temp,4);

ospi_read(ESC_PMU_CTL0,(uint8_t*)&temp,4);

__________________________________________________________________________________________________________________________

______________________HPDF________________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/12_HPDF_I2S_Audio/main.c
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/12_HPDF_I2S_Audio/gd32h73x_75x_it.c

fix reason:
Change the I2S audio playback from DMA double-buffer mode to SPI1 interrupt
transmit mode, and add timeout mechanism to the DMA transfer flag waiting
loops to avoid dead loops.

V1.1.0:
See V1.1.0 change log for the old implementation (DMA double-buffer mode)

V1.2.0:
See V1.2.0 source code for the new implementation (SPI1 interrupt transmit mode)


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/13_HPDF_SAI_Audio/main.c

fix reason:
Add timeout mechanism to the DMA transfer flag waiting loops to avoid dead
loops, and replace the dead loop with error message printing when PLL1 clock
is not stable.

V1.1.0:
See V1.1.0 change log for the old implementation (dead loops)

V1.2.0:
See V1.2.0 source code for the new implementation (FW_WAIT_WHILE_TIMEOUT)


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/13_HPDF_SAI_Audio/systick.h

fix reason:
Add the SysTick_Handler function declaration.

V1.1.0:
none

V1.2.0:
/* SysTick exception handler */
void SysTick_Handler(void);

__________________________________________________________________________________________________________________________

______________________OSPI________________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/15_OSPI_Octal_Flash/Soft_Drive/gd25x512me.c

fix reason:
Configure both OSPIM port0 and port1 source for OSPI0 and OSPI1.

V1.1.0:
See V1.1.0 change log for the old implementation (single port config)

V1.2.0:
See V1.2.0 source code for the new implementation (dual port config)


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/15_OSPI_Octal_Flash/Soft_Drive/gd25x512me.h
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/15_OSPI_Octal_Flash/Soft_Drive/gd25x512me.c

fix reason:
Add timeout mechanism to the OSPI BUSY flag waiting loop in the memory map
mode enable functions to avoid dead loops, and change the return type of
ospi_flash_memory_map_mode_wrap_enable to ErrStatus.

V1.1.0:
void ospi_flash_memory_map_mode_wrap_enable(uint32_t ospi_periph, ospi_parameter_struct *ospi_struct, interface_mode mode, addr_size addr_size);

    /* wait BUSY bit to 0 */
    while(RESET != ospi_flag_get(ospi_periph, OSPI_FLAG_BUSY)) {
    }

V1.2.0:
ErrStatus ospi_flash_memory_map_mode_wrap_enable(uint32_t ospi_periph, ospi_parameter_struct *ospi_struct, interface_mode mode, addr_size addr_size);

    /* wait BUSY bit to 0 */
    FW_WAIT_WHILE_TIMEOUT(RESET != ospi_flag_get(ospi_periph, OSPI_FLAG_BUSY), 100, ret);
    if(ERROR == ret) {
        printf("[ERROR] [%s:%d] OSPI_FLAG_BUSY get timeout !!!\r\n", __FILE__, __LINE__);
        return ret;
    }


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/15_OSPI_Octal_Flash/main.c

fix reason:
Check the return value of ospi_flash_memory_map_mode_wrap_enable and handle
the timeout error.

V1.1.0:
        ospi_flash_memory_map_mode_wrap_enable(OSPI_INTERFACE, &ospi_struct, OSPI_MODE, GD25X512ME_3BYTES_SIZE);

V1.2.0:
        ret = ospi_flash_memory_map_mode_wrap_enable(OSPI_INTERFACE, &ospi_struct, OSPI_MODE, GD25X512ME_3BYTES_SIZE);
        if(ERROR == ret) {
            printf("OSPI memory mapped mode wrap enable timeout!\r\n");
            while(1){
            }
        }

__________________________________________________________________________________________________________________________

______________________RCU_________________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/20_RCU_Clock_Out/main.c

fix reason:
Replace the dead loops with error message printing when the oscillator
stabilization wait times out, and delete the dead loop in the default case
of the clock output selection.

V1.1.0:
See V1.1.0 change log for the old implementation (dead loops)

V1.2.0:
See V1.2.0 source code for the new implementation (error printing)

__________________________________________________________________________________________________________________________

______________________RTC_________________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/22_RTC_Calendar/main.c

fix reason:
Check the return value of the oscillator stabilization wait in rtc_pre_config
and change its return type to ErrStatus, handle the RTC pre-config failure
in main function.

V1.1.0:
void rtc_pre_config(void);

    rtc_pre_config();

void rtc_pre_config(void)
{
#if defined (RTC_CLOCK_SOURCE_IRC32K)
    rcu_osci_on(RCU_IRC32K);
    rcu_osci_stab_wait(RCU_IRC32K);
    rcu_rtc_clock_config(RCU_RTCSRC_IRC32K);

#elif defined (RTC_CLOCK_SOURCE_LXTAL)
    rcu_osci_on(RCU_LXTAL);
    rcu_osci_stab_wait(RCU_LXTAL);
    rcu_rtc_clock_config(RCU_RTCSRC_LXTAL);

    rcu_periph_clock_enable(RCU_RTC);
    rtc_register_sync_wait();
}

V1.2.0:
ErrStatus rtc_pre_config(void);

    if(ERROR == rtc_pre_config()) {
        printf("\n\r RTC pre-config failed! \n\r");
        while(1) {
        }
    }

ErrStatus rtc_pre_config(void)
{
#if defined (RTC_CLOCK_SOURCE_IRC32K)
    rcu_osci_on(RCU_IRC32K);
    if(ERROR == rcu_osci_stab_wait(RCU_IRC32K)) {
        printf("\n\r RCU_IRC32K stabilization timeout! \n\r");
        return ERROR;
    }
    rcu_rtc_clock_config(RCU_RTCSRC_IRC32K);

#elif defined (RTC_CLOCK_SOURCE_LXTAL)
    rcu_osci_on(RCU_LXTAL);
    if(ERROR == rcu_osci_stab_wait(RCU_LXTAL)) {
        printf("\n\r RCU_LXTAL stabilization timeout! \n\r");
        return ERROR;
    }
    rcu_rtc_clock_config(RCU_RTCSRC_LXTAL);

    rcu_periph_clock_enable(RCU_RTC);
    rtc_register_sync_wait();

    return SUCCESS;
}

__________________________________________________________________________________________________________________________

______________________SPI_________________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/14_SPI_Quad_LCD/Soft_Drive/spi_quad_lcd_driver.c

fix reason:
Add timeout mechanism to the SPI flag waiting loops in lcd_command_write and
lcd_data_write functions to avoid dead loops.

V1.1.0:
See V1.1.0 change log for the old implementation (dead loops)

V1.2.0:
See V1.2.0 source code for the new implementation (FW_WAIT_WHILE_TIMEOUT)


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/14_SPI_Quad_LCD/main.c

fix reason:
Add MPU configuration function to prevent speculative prefetching of external
memory, which may cause CPU read locks and even system errors, and add USART
configuration for printf.

V1.1.0:
See V1.1.0 change log for the old implementation

V1.2.0:
See V1.2.0 source code for the new implementation (mpu_config + USART)

__________________________________________________________________________________________________________________________

______________________USART_______________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/04_USART_Printf/main.c

fix reason:
Add timeout mechanism to the USART transmission complete flag waiting loops
to avoid dead loops, and adjust the USART configuration before systick
configuration for printf output.

V1.1.0:
See V1.1.0 change log for the old implementation

V1.2.0:
See V1.2.0 source code for the new implementation (FW_WAIT_WHILE_TIMEOUT)


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/05_USART_HyperTerminal_Interrupt/main.c
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/05_USART_HyperTerminal_Interrupt/gd32h73x_75x_it.c

fix reason:
Add timeout mechanism to the USART transmit waiting loop to avoid dead loop,
delete the redundant macro definitions in the interrupt file, and modify the
extern declarations of tx_counter and rx_counter to volatile.

V1.1.0:
See V1.1.0 change log for the old implementation

V1.2.0:
See V1.2.0 source code for the new implementation


Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/06_USART_DMA/main.c
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/06_USART_DMA/gd32h73x_75x_it.c
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/06_USART_DMA/gd32h73x_75x_it.h

fix reason:
Add the independent receive complete flag g_receive_complete to fix the wrong
usage of g_transfer_complete for both transmit and receive completion, add
timeout mechanism to the transmit waiting loop, and refine the buffer size
macro definitions.

V1.1.0:
See V1.1.0 change log for the old implementation

V1.2.0:
See V1.2.0 source code for the new implementation

__________________________________________________________________________________________________________________________

______________________USB_________________________________________________________________________________________________

Fix file:
../GD32H73x_75x_75E_Demo_Suites/GD32H75EY_EVAL_Demo_Suites/Projects/27_USB_Device/CDC_ACM/src/gd32h73x_75x_usb_hw.c

fix reason:
Modify the USBHS clock divider from DIV8 to DIV10, and delete the redundant
USBHS clock selection and configuration functions.

V1.1.0:
See V1.1.0 change log for the old implementation

V1.2.0:
See V1.2.0 source code for the new implementation

__________________________________________________________________________________________________________________________

******************* V1.1.0 2026-02-26 ******************************************************************************************
______________________Common______________________________________________________________________________________________
1. Change the GD32H75E_Demo_Suites to GD32H3x_75x_Demo_Suites
2. Update the Firmware to V1.5.0
3. Add GD32EmbeddedBuilder Project
4. Update gd32h75ey_eval.c, gd32h75ey_eval.h
5. Delete the serial port print remapping in main.c